﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoDeploy.Client
{
    /// <summary>
    /// 多项目配置
    /// </summary>
    internal class ProjectConfig
    {
        /// <summary>
        /// pm2 name 不可重复
        /// </summary>
        public required string Name { get; set; }
        /// <summary>
        /// 中间件类型：pm2  iis 
        /// 暂时只支持pm2
        /// </summary>
        public string Type { get; set; } = "pm2";
        /// <summary>
        /// 服务器地址，结尾带/ 
        /// </summary>
        public string? ServerUrl { get; set; }
        /// <summary>
        /// $(OutDir)  
        /// local path
        /// </summary>
        public string? PublishFolder { get; set; }
        /// <summary>
        /// upload  
        /// server path
        /// </summary>
        public required string DeployFolder { get; set; }
        /// <summary>
        /// 忽略文件名、文件夹/，支持*通配符
        /// </summary>
        public string[] Ignore { get; set; } = { };

        /// <summary>
        /// Development：pm2 restart; Production： pm2 reload
        /// </summary>
        public string Environment { get; set; } = "Development";
        /// <summary>
        /// 目标架构，runtimes 文件夹里只扫描目标框架,如果为空，则全扫描
        /// linux-arm64
        /// </summary>
        public string? Arch { get; set; }
    }
}
